package Str;

/**
 * @auther wangchenghao
 * @date 2021/6/7
 **/
public class test1 {
    public static void reverseString(char[] s) {
        int first = 0;
        int last = s.length-1;
        while (first < last) {
            char temp = s[first];
            s[first] = s[last];
            s[last] = temp;

            first++;
            last--;
        }

    }

    public static void main(String[] args) {
        char[] s = {'h', 'e', 'l', 'l', 'o'};
        reverseString(s);
    }
}
